From: Andrew Cooper Date: Mon, 25 Nov 2013 11:07:44 +0000 (+0000) Subject: tools/xenstored: Don't leak a file handle when creating the pidfile X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~5873 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=375b0e1bfba15d4493a24d7b0e33d573d0e2fc3a;p=xen.git tools/xenstored: Don't leak a file handle when creating the pidfile Coverity ID: 1055849 Signed-off-by: Andrew Cooper CC: Ian Campbell Acked-by: Ian Jackson --- diff --git a/tools/xenstore/xenstored_posix.c b/tools/xenstore/xenstored_posix.c index 25bdf74716..0c93e6d688 100644 --- a/tools/xenstore/xenstored_posix.c +++ b/tools/xenstore/xenstored_posix.c @@ -44,6 +44,8 @@ void write_pidfile(const char *pidfile) len = snprintf(buf, sizeof(buf), "%ld\n", (long)getpid()); if (write(fd, buf, len) != len) barf_perror("Writing pid file %s", pidfile); + + close(fd); } /* Stevens. */